import request from '../utils/request'
import { HttpMethod } from '../utils/http'


export default {
  // 创建订单
  createOrder (data) {
    return request({
      url: '/beauty/order/createOrder',
      method: HttpMethod.POST,
      data
    })
  },

  // 分页获取客户的所有订单信息
  getMemberOrders (query) {
    return request({
      url: `/beauty/order/getMemberOrders`,
      method: HttpMethod.GET,
      params: query
    })
  },
  // 客户取消订单 只有待付款的才能取消 其他 的取消需要通过后台
  cancelMemberOrder (orderId) {
    return request({
      url: `/beauty/order/cancelMemberOrder/${orderId}`,
      method: HttpMethod.PUT
    })
  },
  // 查询当前客户的所有订单项
  getMemberOrderItems (orderId) {
    return request({
      url: `/beauty/order/getMemberOrderItems/${orderId}`,
      method: HttpMethod.GET
    })
  },
  // 订单确认付款
  confirmMemberOrderPay (orderId) {
    return request({
      url: `/beauty/order/confirmMemberOrderPay/${orderId}`,
      method: HttpMethod.POST
    })
  },
  // 查询客户当前订单信息
  getMemberOrder (orderId) {
    return request({
      url: `/beauty/order/getMemberOrder/${orderId}`,
      method: HttpMethod.GET
    })
  },
  // 客户确认已经服务完毕
  confirmMemberOrder (orderId) {
    return request({
      url: `/beauty/order/confirmMemberOrder/${orderId}`,
      method: HttpMethod.PUT
    })
  },
  // 获取客户未评价的订单项
  getNotEvaluationMemberOrderItems (orderId) {
    return request({
      url: `/beauty/order/getNotEvaluationMemberOrderItems/${orderId}`,
      method: HttpMethod.GET
    })
  },
}
